//
//  CustomOverlayView.swift
//  ReadHub
//
//  Created by testypp on 2018/1/8.
//  Copyright © 2018年 longyiqun. All rights reserved.
//

import Foundation
import UIKit
import Koloda

private let overlayRightImageName = "overlay_like"
private let overlayLeftImageName = "overlay_skip"

class CustomOverlayView: OverlayView {
	
	
	override var overlayState: SwipeResultDirection?  {
		didSet {
			switch overlayState {
			case .left? :
				overlayImageView.image = UIImage(named: overlayLeftImageName)
			case .right? :
				overlayImageView.image = UIImage(named: overlayRightImageName)
			default:
				overlayImageView.image = nil
			}
			
		}
	}
	
	@IBOutlet lazy var overlayImageView: UIImageView! = {
		[unowned self] in
		
		var imageView = UIImageView(frame: self.bounds)
		//imageView.layer.cornerRadius = 10.0
		self.addSubview(imageView)
		
		return imageView
		}()
	
}
